package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserTypeCount;
import com.culturalCenter.dataCenter.mapper.user.UserTypeCountMapper;
import com.culturalCenter.dataCenter.service.user.UserTypeCountService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserTypeCount业务层接口实现类
 * @Date
 *****/
@Service
public class UserTypeCountServiceImpl implements UserTypeCountService {

    @Resource
    private UserTypeCountMapper userTypeCountMapper;

    @Override
    public PageInfo<UserTypeCount> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userTypeCountMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userTypeCountMapper.deleteById(id);
    }

    @Override
    public Integer update(UserTypeCount userTypeCount) {
        return userTypeCountMapper.update(userTypeCount);
    }

    @Override
    public Integer add(UserTypeCount userTypeCount) {
        return userTypeCountMapper.insert(userTypeCount);
    }

    @Override
    public UserTypeCount findById(String id) {
        return userTypeCountMapper.queryById(id);
    }

    @Override
    public List<UserTypeCount> findAll(UserTypeCount userTypeCount) {
        return (List<UserTypeCount>) userTypeCountMapper.queryAll(userTypeCount);
    }

}
